﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox.Workflows.Conditions
{
    public sealed class CustomCondition : TransitionCondition
    {
        public CustomCondition()
        {
        }

        public CustomCondition(Dictionary<string, string> parameters)
        {
            parameters.TryGetValue("key", out _key);
        }

        private string _key;

        public string Key
        {
            get { return _key; }
            set { _key = value; }
        }

        protected internal override bool Test(ConditionTestArguments args)
        {
            return args.Stage.Workflow.TestCustomCondition(args, this);
        }
    }
}
